<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class news extends MX_Controller
{
	function news()
	{
		parent::__construct();
		$this->check_login();
	}

	function index()
	{
		$data['title'] = 'news';
		$data['content_admin'] = 'index';
		$this->load->view('back_end/template_admin', $data);
	}

	function add($id = "")
	{
		if ($id == "")
		{
			$data['title'] = 'Add news';
			$data['content_admin'] = 'add';
		}
		else
		{
			$data['title'] = 'Update news';
			$data['content_admin'] = 'edit';
		}
		$this->load->view('back_end/template_admin', $data);
	}

	function delete($id = "")
	{
		$data['title'] = 'Delete news';
		redirect(base_url().'admin_news/news');
	}
}